package 设计原则;

/**
 * TODO
 *
 * @author scylla
 * @version V1.0
 * @project echo-java-base
 * @title
 * @package 临时示例包
 * @since 2023/2/23 7:11 下午
 */
public class Isp {
    interface Animal {
        void eat();
    }


    interface RunAnimal extends Animal {
        void run();
    }

    interface FlyAnimal extends Animal {
        void fly();
    }

    interface SwimAnimal extends Animal {
        void swim();
    }

    class Dog implements RunAnimal {

        @Override
        public void run() {

        }

        @Override
        public void eat() {
            System.out.println("狗子开吃了");
        }
    }

    class Duck implements SwimAnimal {

        @Override
        public void eat() {
            System.out.println("鸭子开吃了");
        }

        @Override
        public void swim() {

        }
    }
    

    class SomeBody{
        void feed(Animal animal){
            animal.eat();
        }
    }
}
